package com.pphh.demo.consumer;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.pphh.demo.DemoService;

/**
 * Please add description here.
 *
 * @author huangyinhuang
 * @date 11/12/2018
 */
public class Consumer {

    public static void main(String[] args) {
        ReferenceConfig<DemoService> reference = new ReferenceConfig<>();
        reference.setApplication(new ApplicationConfig("first-dubbo-consumer"));
        reference.setRegistry(new RegistryConfig("multicast://224.5.6.7:1234"));
        reference.setInterface(DemoService.class);
        reference.setVersion("1.0.0");
        DemoService greetingsService = reference.get();
        String message = greetingsService.sayHello("michael");
        System.out.println(message);
    }

}
